extends ../layout

block content
  .container
    .row
      form.form-horizontal(method="post", action="/admin/movie/", enctype="multipart/form-data")
        .form-group
          label.col-sm-2.control-label(for='inputTitle') 同步豆瓣数据
          .col-sm-10
            input#douban.form-control(type="text", placeholder="请输入豆瓣电影的subject_ID")
        if movie._id
          input(type="hidden", name="movie[_id]", value=movie._id)
        .form-group
          label.col-sm-2.control-label(for='inputCategory') 新增分类
          .col-sm-10
            input#inputCategory.form-control(type="text", name="movie[categoryName]", value=movie.categoryName)
        .form-group
          label.col-sm-2.control-label 分类选择
          each category in categories
            label.radio-inline
              if movie._id
                input(type="radio", name="movie[category]", value=category._id, checked=category._id.toString()==movie.category)
              else
                input(type="radio", name="movie[category]", value=category._id)
              | #{category.name}
        .form-group
          label.col-sm-2.control-label(for='inputTitle') 电影名字
          .col-sm-10
            input#inputTitle.form-control(type="text", name="movie[title]", value=movie.title)
        .form-group
          label.col-sm-2.control-label(for='inputDirector') 电影导演
          .col-sm-10
            input#inputDirector.form-control(type="text", name="movie[director]", value=movie.director)
        .form-group
          label.col-sm-2.control-label(for='inputCountry') 国家
          .col-sm-10
            input#inputCountry.form-control(type="text", name="movie[country]", value=movie.country)
        .form-group
          label.col-sm-2.control-label(for='inputLanguage') 语种
          .col-sm-10
            input#inputLanguage.form-control(type="text", name="movie[language]", value=movie.language)
        .form-group
          label.col-sm-2.control-label(for='inputPoster') 海报地址
          .col-sm-10
            input#inputPoster.form-control(type="text", name="movie[poster]", value=movie.poster)
        .form-group
          label.col-sm-2.control-label(for='uploadPoster') 海报上传
          .col-sm-10
            input#uploadPoster(type="file", name="uploadPoster")
        .form-group
          label.col-sm-2.control-label(for='inputFlash') 片源地址
          .col-sm-10
            input#inputFlash.form-control(type="text", name="movie[flash]", value=movie.flash)
        .form-group
          label.col-sm-2.control-label(for='inputYear') 上映年代
          .col-sm-10
            input#inputYear.form-control(type="text", name="movie[year]", value=movie.year)
        .form-group
          label.col-sm-2.control-label(for='inputSummary') 电影简介
          .col-sm-10
            textarea#inputSummary.form-control(name="movie[summary]", value=movie.summary, rows=10, style="resize: none !important")
        div.text-center
          input.btn.btn-default(type="submit", value="录入")
  br
  br
  br
  script(src="/js/admin.js")
